package org.nanotek.lucene;

import java.util.List;

import org.nanotek.beans.ArtistKey;
import org.nanotek.dao.spring.ArtistDAO;
import org.springframework.batch.core.JobParametersInvalidException;
import org.springframework.batch.core.launch.JobExecutionNotRunningException;
import org.springframework.batch.core.launch.NoSuchJobException;
import org.springframework.batch.core.launch.NoSuchJobExecutionException;
import org.springframework.batch.core.launch.support.SimpleJobOperator;
import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException;
import org.springframework.batch.core.repository.JobRestartException;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ArtistKeyBootLoader {
	//	lucene-indexer-context.xml

	private static ClassPathXmlApplicationContext ctx;
	public static final Integer MAX_RECORDS = 10000;
	/**
	 * @param args
	 * @throws JobParametersInvalidException 
	 * @throws JobInstanceAlreadyCompleteException 
	 * @throws JobRestartException 
	 * @throws JobExecutionAlreadyRunningException 
	 * @throws NoSuchJobException 
	 * @throws JobExecutionNotRunningException 
	 * @throws NoSuchJobExecutionException 
	 */
	@SuppressWarnings("unchecked")
	public static void main(String[] args)  {
		try { 
			ctx = new ClassPathXmlApplicationContext(new String[] {
			"spring-artist-key-context.xml"});
			SimpleJobOperator jobOperator =   (SimpleJobOperator) ctx.getBean("jobOperator");
			jobOperator.start("artistKeyJob", "");
		}catch (Exception ex) 
		{ 
			ex.printStackTrace();
		}
	}
}
